package com.samuel.basics.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 角色信息表
 * </p>
 *
 * @author kaiji
 * @since 2019-08-17
 */
@TableName("t_role")
public class RoleEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 角色名称
     */
    @TableField("name")
    @NotNull(message = "请输入角色名称！")
    @Length(min = 2, max = 25, message = "名称是2到25个字符之间！")
    private String name;

    @TableField("code")
    @NotBlank(message = "请输入角色代码！")
    private String code;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
